#include <stdio.h>
#define MAXLEN 10

int main(void)
{
	char str[MAXLEN];
	int i = 0;

	do {
		scanf("%c", &str[i]);
		printf("get: %c\n", str[i]);
		i++;
	} while (str[i - 1] != '\n' && i < MAXLEN - 1); // 若放满，在str[MAXLEN - 1]处放'\0'
	
	if (str[i - 1] == '\n') {
		str[i - 1] = '\0';

		str[i] = '\0';
	}
	printf("输入的字符串：\"%s\"\n", str);

	return 0;
}
